package com.woniuxy.house.entity;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * jwt通信实体类
 * @author baobo
 * @date 2022-08-29-12:37
 */
public class JwtToken extends AbstractAuthenticationToken {
	private  String jwt;
	public JwtToken(String jwt,boolean authenticated,Collection<? extends GrantedAuthority> authorities) {
		super(authorities);
		this.jwt=jwt;
		setAuthenticated(authenticated);
	}
	public JwtToken(String jwt) {
		super((Collection)null);
		this.jwt=jwt;
		this.setAuthenticated(false);
	}
	@Override
	public Object getCredentials() {
		return jwt;
	}
	@Override
	public Object getPrincipal() {
		return jwt;
	}
}
